package pl.edu.agh.neurony.gui.customSwingComponents;

import java.awt.GridLayout;
import java.awt.LayoutManager;

import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;

public class EtchedBorderPanel extends JPanel {

	public EtchedBorderPanel(JComponent comp, String title) {
		super(new GridLayout(1, 1), false);
		
		Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
        TitledBorder titled = BorderFactory.createTitledBorder(loweredetched, title);
		setBorder(titled);
		
		add(comp);
	}
	
	public EtchedBorderPanel(JComponent comp, String title, LayoutManager manager) {
		super(manager, false);
		
		Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
        TitledBorder titled = BorderFactory.createTitledBorder(loweredetched, title);
		setBorder(titled);
		
		add(comp);
	}
}
